package com.AX.mapper;

import com.AX.entity.NavEdge;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;


//查询停车场边
@Mapper
public interface NavEdgeMapper {

    @Select("SELECT * FROM nav_edges WHERE start_node = #{nodeId} OR end_node = #{nodeId}")
    @Results({
            @Result(property = "edgeId", column = "edge_id"),
            @Result(property = "startNode", column = "start_node"),
            @Result(property = "endNode", column = "end_node"),
            @Result(property = "parkingLotId", column = "parking_lot_id"),
            @Result(property = "position", column="position" ,typeHandler=com.AX.handler.GeoPointTypeHandler.class)
    })
    List<NavEdge> findConnectedEdges(String nodeId);
}
